package common.dynamic;

/**
 * 198. 打家劫舍
 */
public class _198_Rob {

    public static int rob(int[] nums) {
        if (nums == null || nums.length == 0) {
            return 0;
        }
        int length = nums.length;
        int p1 = 0;
        int p2 = 0;
        int res = 0;
        for (int i = 0; i < length; i++) {
            res = Math.max(p2 + nums[i], p1);
            p2 = p1;
            p1 = res;
        }
        return res;
    }

    public static void main(String[] args) {
        System.out.println(3*0.1);
        System.out.println(3*0.1==0.3);
    }
}
